<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>Title</title>
    </head>
    <body>
        <div id="div1">div</div>
        <script>
            var div1 = document.getElementById("div1");
            var innerHTML = div1.innerHTML;
            alert(innerHTML);

            //div标签中替换成一个文本输入框
           // div1.innerHTML="<input type='text'>";
            //div标签中追加一个文本输入框
            div1.innerHTML+="<input type='text'>";

        </script>

        
    </body>
</html>